#include<stdio.h>
#include<stdlib.h>

int g_val1;
int g_val2 = 10;

int main()
{
	printf("code addr:%p\n", main); //main函数的地址
	const char* str = "hello linux";
	printf("read only string addr:%p\n", str); //字符常量区
	printf("init global value address:%p\n", &g_val2); //已初始化全局变量区
	printf("uninit global value address:%p\n", &g_val1); //未初始化全局变量区
	char *m = (char*)malloc(sizeof(char) * 100);
	printf("heap addr:%p\n", m); //堆区
	printf("stack addr:%p\n", &str); //栈区
	
	free(m);
	return 0;
}
